<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<head>
    <title>Title</title>
    <%@include file="../../common.jsp"%>
</head>
<style>
    body{
        font-size: 12px;
    }
    #taskTable tr{
        font-size: 12px;
    }
    .layui-table-cell {
        overflow: visible;
    }

    .layui-table-box {
        overflow: visible;
    }

    .layui-table-body {
        overflow: visible;
    }
    /* 设置下拉框的高度与表格单元相同 */
    td .layui-form-select{
        margin-top: -10px;
        margin-left: -15px;
        margin-right: -15px;
    }
</style>
<body>
<h2>消缺任务查询
</h2>
<hr>
    <form class="layui-form" action="">
        <div class="layui-form-item">

            <div class="layui-inline">
                <label class="layui-form-label">任务编号:</label>
                <div class="layui-input-inline" style="width: 200px;">
                    <input id="solveTaskCode" type="text" name="price_min" autocomplete="off" class="layui-input">
                </div>
                <label class="layui-form-label">任务状态:</label>
                <div class="layui-input-inline">
                    <select id="taskStateId">
                        <option value="-1">请选择</option>
                        <option value="1">待分配</option>
                        <option value="2">已分配</option>
                        <option value="3">执行中</option>
                        <option value="4">已完成</option>
                    </select>
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">下发时间:</label>
                <div class="layui-input-inline">
                    <input type="text" class="layui-input" id="startTime" placeholder="yyyy-MM-dd">
                </div>
                <div class="layui-form-label" style="width:5px">-</div>
                <div class="layui-input-inline">
                    <input type="text" class="layui-input testl" id="endTime" placeholder="yyyy-MM-dd">
                </div>


                <div class="layui-input-inline" style="width: 100px;">
                    <button type="button" class="layui-btn layui-btn-normal" onclick="searchData();"><i class="layui-icon layui-icon-search"></i> 查询</button>
                </div>
            </div>

        </div>
    </form>
    <table class="layui-table" id="taskTable" lay-filter="taskTable"></table>

    <script>


        var taskId;//巡检任务编号,用户查看任务详情
        //全局定义一次, 加载formSelects
        layui.config({
            base: '${path}/layui/lay/modules/' //此处路径请自行处理, 可以使用绝对路径
        }).extend({
            formSelects: 'formSelects-v4.min'
        });


       function searchData(){
            layui.table.reload("taskTable",{
                page:{
                    curr : 1
                },
                where:{
                    "solveTaskCode":$("#solveTaskCode").val(),
                    "issuedByName" : $("#issuedByName").val(),
                    "startTime" : $("#startTime").val(),
                    "endTime" : $("#endTime").val(),
                    "taskStateId" : $("#taskStateId").val()
                }
            });
        }


        layui.use(["table","form","formSelects","laydate"],function () {
            var table = layui.table;
            table.render({
                id:'taskTable',
                elem:'#taskTable',
                url:'/solveTaskMain/solverSelect',
                page:true,
                even:false,
                cols:[[
                    {field:'solveTaskCode', title:'任务编号'},
                    {field:'solveTaskName', title:'任务名称'},
                    {field:'workDocTypeName', title:'工作单据'},
                    {field:'issuedByName', title:'下发人'},
                    {field:'issuedTime', title:'下发时间'},
                    {field:'taskStateName', title:'任务状态'},
                    {field:'createdBy', title:'创建人'},
                    {field:'isStart', title:'任务是否取消',templet:'#lockedTem'},
                ]]
            })
        });

        layui.use('laydate',function () {
           var laydate = layui.laydate;

           laydate.render({
               elem:'#startTime'
           });
           laydate.render({
                elem:'#endTime'
           });
            laydate.render({
                elem: '#issuedTime'
                ,value: new Date()
                ,isInitValue: true
            });
        });

    </script>
    <script type="text/html" id="lockedTem">
        <input type="checkbox" disabled lay-skin="switch" title="是否取消" lay-text="是|否" {{d.isCancel == 1 ? 'checked' : ''}}>
    </script>

</body>
</html>
